﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Draggable</title>
    <!-- Script -->
    <script src="script/jquery-1.3.2.js" type="text/javascript"></script>
    <script src="script/ui.core.js" type="text/javascript"></script>
    <script src="script/ui.draggable.js" type="text/javascript"></script>
    
     <!-- Script memilih elemen untuk diberikan kemampuan drag -->
    <script language="javascript" type="text/javascript">
        $(document).ready(function() {
            $("#draggable").draggable({
                start: function() {
                    $("#start").val(parseInt($("#start").val()) + 1);
                },
                drag: function() {
                    $("#drag").val(parseInt($("#drag").val()) + 1);
                },
                stop: function() {
                    $("#stop").val(parseInt($("#stop").val()) + 1);
                }
            });
        });

    
    </script>

    <link href="css/ui.all.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        #draggable 
        { 
            width:113px;
            height:113px;
            border:solid 3px #000;
            padding:13px;
            color:Black;
            font-weight:bold;
            background-color:Red;
        }
        
        input
        {
            width:32px;
        }
    </style>
</head>
<body>
    Start : <input type="text" id="start" value="0" />
    Drag : <input type="text" id="drag" value="0" />
    Stop : <input type="text" id="stop" value="0" />
    <div id="draggable">
        <p>Drag me around</p>
    </div>

</body>
</html>
